package fun.mashuai.copy;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.file.FileReader;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.extra.compress.CompressUtil;
import cn.hutool.extra.compress.extractor.Extractor;

import java.io.File;
import java.util.List;

/**
 * @author 马帅
 * @version 1.0
 * @className RasterExtract.java
 * @description TODO
 * @date 2022/3/26 23:07
 */
public class RasterExtract {


    public static void main(String[] args) {
        Extractor extractor = CompressUtil.createExtractor(
                CharsetUtil.defaultCharset(),
                FileUtil.file("D:\\data\\bing\\BingMapTest\\15.tar"));

        extractor.extract(FileUtil.file("D:\\data\\bing\\BingMapTest"));

        FileReader reader = new FileReader("D:\\data\\bing\\BingMapTest\\14-test\\14\\zero_bytes.txt");
        List<String> list = reader.readLines();
        for(String s : list){
            File file = FileUtil.file("D:\\data\\bing\\BingMapTest\\14-test\\14\\" + s);
            if(!file.exists()){
                FileUtil.writeBytes(new byte[0], file.getPath());
                System.out.println("成功创建：" + file.getPath());
            }
        }



    }
}
